package com.liuhx.controller;

import com.liuhx.entity.CityEntity;
import com.liuhx.service.CityService;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * Created by liuhx on 2017/6/21.
 */
@RestController
@RequestMapping("city")
public class CityController {
    @Resource
    CityService cityService;
    @RequestMapping("insertCitys")
    public Map insertCitys(@RequestBody List<CityEntity> cityEntityList)
    {
        cityService.insertCitys(cityEntityList);
        Map map = new HashMap();
        map.put("code",200);
        return map;
    }

    @RequestMapping("findCitys")
    public List<CityEntity> findCitys(){
        return cityService.findCitys();
    }
}
